#! /bin/bash
#当前目录
SCRIPTS_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo 'script home is: '${SCRIPTS_HOME}

#杀进程
#PID="`ss -anp|grep 8888| cut -d , -f 2`"
PID=`ps -ef|grep "AppStart.*6666$" | awk '{print $2}'`
echo 'pid is: '${PID}
if [ ! ${PID} ];then
    echo "process not found!"
else
	kill -9 ${PID}
    echo "process killed!"
fi
sleep 1
#
cd ${SCRIPTS_HOME}/src/frontend
grunt build --force
cd ${SCRIPTS_HOME}
mvn exec:java -Dexec.mainClass="app.AppStart" -Dexec.args="6666" >keter.out&

